<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <link rel="stylesheet" href="https://www.layuicdn.com/layui/css/layui.css">
    <script src="https://www.layuicdn.com/layui/layui.js"></script>
    <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
</head>
<body>

<form class="layui-form">
    <input type="hidden" th:value="${gl.buildingid}" name="buildingid">
    <div class="layui-form-item">
        <label class="layui-form-label">楼号</label>
        <div class="layui-input-block">
            <input type="text" name="buildingname" th:value="${gl.buildingname}" id="name" lay-verify="title" autocomplete="off"  class="layui-input" disabled="disabled">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">总楼层</label>
        <div class="layui-input-block">
            <input type="text" name="loucengcount" th:value="${gl.loucengcount}" id="lc"   class="layui-input">
        </div>
    </div>

    <div style="margin-left: 210px">
        <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="tijiao">提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
</form>


<script type="text/javascript">
    layui.use(['form', 'layer', 'laydate'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,laydate = layui.laydate
            ,$=layui.jquery;
        //监听提交
        form.on('submit(tijiao)', function(data){
            //data.field表单所有信息
            $.post("upLou",data.field,function(result)
                {
                    if(result.data==false){
                        layer.msg(result.msg, {
                            icon: 1,
                            time: 1000 //2秒关闭（如果不配置，默认是3秒）
                        })

                    }
                    else {
                        layer.msg(result.msg, {
                                icon: 1,
                                time: 1000 //2秒关闭（如果不配置，默认是3秒）
                            },

                            function () {
                                //刷新父页面
                                parent.window.location.reload();
                            });
                    }
                }
            );
            return false;
        });
        //重置清空文本框
        $("#reset").click(function () {

            $("#lc").val("");
            form.render();

        })
    });
</script>

</body>

</html>